'use strict'

//作用域结构

/*function foo(){
    var x=1;
     function bar(){
         var x='A';
         console.log('x in bar()= ' + x);
     }
     console.log('x in foo() =' + x );
     bar();
}
foo();*/

//变量 

//解析赋值

var arr=['村里有只纯种的阿黄','年龄有','1岁'];
var a=arr[0];
var b=arr[1];
var c=arr[2];

console.log(a);
console.log(b);
console.log(c);



var [a,b,c]=['村里有只纯种的阿黄','年龄有','1岁']

console.log(a+b+c);    

//解析赋值
let [,,ab]=['Hello','Worlld','C++'];
console.log(ab);

var strs={
    name:'隔壁的老王',
    age:18,
    scholl:'beida',
    score:99
};
    var {name,age,scholl,score}=strs;

    console.log(name+age+scholl+score);


    var person={
        name:'朱鹏学长',
        age:8,
        xunou:'家里有矿，寻找长得好看，人美声甜的小姐姐',
        school:'mougaoxiao',
        address:{
            city:'begjing',
            street:'No.1Road',
            zipcode:'00001'
        }
    };

    var {name,age,address:{city,street}}=person;

    console.log(name);
    console.log(city);
    console.log(street);

















